//
//  NetWorking.h
//  pacc
//
//  Created by 测试 on 2018/5/17.
//  Copyright © 2018年 测试. All rights reserved.
//

#import <Foundation/Foundation.h>
@protocol RHURLRequestDelegate;
typedef void(^callBack)(NSDictionary *dic);
@interface NetWorking : NSObject
//代理属性
@property (nonatomic, weak)id<RHURLRequestDelegate> delegate;

typedef void (^CompletioBlock)(NSDictionary *dic, NSURLResponse *response, NSError *error);
typedef void (^SuccessBlock)(NSDictionary *data);
typedef void (^FailureBlock)(NSError *error);

+(void)getCode:(NSString *)PhoneStr btn:(UIButton*)huoquyanzhengmaBtn;
//上传
+ (void)upDateHeadIcon:(UIImage *)photo parameters:(NSMutableDictionary*)parameters imageName:(NSString*)imageName success:(SuccessBlock)successBlock failure:(FailureBlock)failureBlock;
//POST请求接口方法
+ (void)startPOSTRequestWithUrl:(NSString *)url parameters:(NSDictionary *)parameters logMes:(NSString *)logMes show:(BOOL)isShow  success:(SuccessBlock)successBlock failure:(FailureBlock)failureBlock;
+ (void)startPOSTRequestWithUrl2:(NSString *)url parameters:(NSDictionary *)parameters logMes:(NSString *)logMes success:(SuccessBlock)successBlock failure:(FailureBlock)failureBlock;

//GET请求接口方法
- (void)startGETRequestWithUrl:(NSString *)url parameters:(NSDictionary *)parameters;
@end
//代理协议及方法
@protocol RHURLRequestDelegate <NSObject>

//请求成功回调的方法，参数为请求得到的解析之后的数据
- (void)requestDidSuccessData:(id)data;
//请求失败回调的方法，参数为请求失败的错误信息
- (void)requestDidFailedError:(NSError *)error;


@end
